/*****************************************************************************

File:   otkGeometryUtils.java

Date          Build     Author        Version    Comments
01-Nov-12    P-20-16    dshah          $$1        Created

****************************************************************************/
   
/* 
 
 Utilites for Geometry methods.
  
*/
package com.ptc.otkjavaexamples;
 
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcCommand.*;
import com.ptc.pfc.pfcGlobal.*;
import com.ptc.pfc.pfcModel.*;
import com.ptc.pfc.pfcModelItem.*;
import com.ptc.pfc.pfcFeature.*;
import com.ptc.pfc.pfcSolid.*;
import javax.swing.JOptionPane;
import java.io.*;

import com.ptc.cipjava.*;
import com.ptc.pfc.pfcFamily.*;
import com.ptc.pfc.pfcServer.*;
import com.ptc.pfc.pfcWindow.*;
import com.ptc.pfc.pfcBase.*;
import com.ptc.pfc.pfcGeometry.*;
import com.ptc.wfc.wfcModel.*;
import com.ptc.pfc.pfcTable.*;
import com.ptc.wfc.wfcGeometry.*;

 
// *************************************************************************************************************** /
class otkGeometryUtils 
{



    public otkGeometryUtils()
    {
    }
    
    public static void OtkUtilInterfaceDataInfo (InterfaceData wInterfaceData, BufferedWriter InterfInfoFile)
    {
	try
	    {
		// ************* surface data info
		WSurfaceDescriptors SurfDescs = wInterfaceData.GetSurfaceData ();
		System.out.println("16");
		
		InterfInfoFile.write("******************* Interface Data : Surface Info ********************* ");
		InterfInfoFile.newLine();
		
		if(SurfDescs != null)
		    {
			InterfInfoFile.write("\t Total of Surface Descriptor : " + SurfDescs.getarraysize());
			InterfInfoFile.newLine();
			
			for(int i = 0; i < SurfDescs.getarraysize(); i++)
			    {			
				InterfInfoFile.write("\t--------- Surface Descriptor : " + (i+1) );
				InterfInfoFile.write(" --------- ");
				InterfInfoFile.newLine();
				OtkUtilSurfaceDescriptorInfo(SurfDescs.get(i), InterfInfoFile);
			    }
		    }
		else
		    {
			InterfInfoFile.write("\t Total of Surface Descriptor : 0");
			InterfInfoFile.newLine();
		    }
		
		
		// ************* Quilt data info 
		QuiltDatas QuiltDatas = wInterfaceData.GetQuiltData ();
		if(QuiltDatas != null)
		    {
			InterfInfoFile.write("\n******************* Interface Data : Quilt Info ********************* ");
			InterfInfoFile.newLine();
			InterfInfoFile.write("\t Total of Quilt Data : " + QuiltDatas.getarraysize());
			InterfInfoFile.newLine();
			
			for(int j = 0; j < QuiltDatas.getarraysize(); j++)
			    {		
				QuiltData QuiltData = QuiltDatas.get(j);
				
				InterfInfoFile.write("\t--------- Quilt Data : " + (j+1));
				InterfInfoFile.write(" --------- ");
				InterfInfoFile.newLine();
				InterfInfoFile.write("\t Quilt Id : " + QuiltData.GetQuiltId());
				InterfInfoFile.newLine();
				
				WSurfaceDescriptors wQuiltSurfDescs = QuiltData.GetSurfaceDescriptors ();
				
				InterfInfoFile.write( "\t Total of Quilt Surface Descriptor : " + wQuiltSurfDescs.getarraysize());
				InterfInfoFile.newLine();
				
				for(int k = 0; k < wQuiltSurfDescs.getarraysize(); k++)
				    {
					InterfInfoFile.write("\t--------- Quilt Surface Descriptor : " + (k+1));
					InterfInfoFile.write(" --------- ");
					InterfInfoFile.newLine();
					
					OtkUtilSurfaceDescriptorInfo(wQuiltSurfDescs.get(k), InterfInfoFile);
				    }
			    } // for(j)
		    } // if(QuiltDatas)
		else
		    {
			InterfInfoFile.write( "\t Total of Quilt Surface Descriptor : 0" );
			InterfInfoFile.newLine();
		    }
		
		
		// ************* Datum data info 
		DatumDatas DatumDatas = wInterfaceData.GetDatumData();
		if(DatumDatas != null)
		    {
			InterfInfoFile.newLine();
			InterfInfoFile.write("******************* Interface Data : Datum Info ********************* ");
			InterfInfoFile.newLine();
			InterfInfoFile.write("\t Total of Datum Data : " + DatumDatas.getarraysize());
			InterfInfoFile.newLine();
			
			for(int x = 0; x < DatumDatas.getarraysize(); x++)
			    {
				DatumData DatumData = DatumDatas.get(x);
				
				InterfInfoFile.write("\t--------- Datum Data : " + (x+1));
				InterfInfoFile.write(" --------- ");
				InterfInfoFile.newLine();
				
				InterfInfoFile.write("\t Datum Id : " + DatumData.GetId());
				InterfInfoFile.newLine();
				InterfInfoFile.write("\t Datum Name : " + DatumData.GetName() );
				InterfInfoFile.newLine();
				
				DatumObject DatumObject = DatumData.GetDatumObject();
				
				if(DatumObject.GetDatumObjectType() == DatumObjectType.DATUM_CURVE)
				    {
					InterfInfoFile.write("\t Datum Object Type : CURVE" );
					InterfInfoFile.newLine();
					
					CurveDatumObject CurveDatumObject = (CurveDatumObject)(DatumObject);
					
					CurveDescriptor CurveDesc = CurveDatumObject.GetCurve();
					
					OtkUtilCurveDescriptorInfo (CurveDesc, InterfInfoFile);				
				    }
				else if(DatumObject.GetDatumObjectType() == DatumObjectType.DATUM_PLANE)
				    {
					InterfInfoFile.write("\t Datum Object Type : PLANE" );
					InterfInfoFile.newLine();
					
					PlaneDatumObject PlaneDatumObject = (PlaneDatumObject)(DatumObject);
					
					WPlaneData wPlaneData = PlaneDatumObject.GetPlaneData();
					
					Vector3D XVector = wPlaneData.GetXAxis ();
					InterfInfoFile.write("\t X- Axis : [ " + XVector.get(0) );
					InterfInfoFile.write(" " + XVector.get(1) );
					InterfInfoFile.write(" " + XVector.get(2) );
					InterfInfoFile.write(" ] ");
					InterfInfoFile.newLine();
					
					Vector3D YVector = wPlaneData.GetYAxis ();
					InterfInfoFile.write("\t Y- Axis : [ " + YVector.get(0) );
					InterfInfoFile.write(" " + YVector.get(1) );
					InterfInfoFile.write(" " + YVector.get(2) );
					InterfInfoFile.write(" ] ");
					InterfInfoFile.newLine();
					
					Vector3D ZVector = wPlaneData.GetZAxis ();
					InterfInfoFile.write("\t Z- Axis : [ " + ZVector.get(0) );
					InterfInfoFile.write(" " + ZVector.get(1) );
					InterfInfoFile.write(" " + ZVector.get(2) );
					InterfInfoFile.write(" ] ");
					InterfInfoFile.newLine();
					
					Point3D Origin = wPlaneData.GetOrigin ();
					InterfInfoFile.write("\t Origin : [ " + Origin.get(0) );
					InterfInfoFile.write(" " + Origin.get(1) );
					InterfInfoFile.write(" " + Origin.get(2) );
					InterfInfoFile.write(" ] ");
					InterfInfoFile.newLine();
				    }
				else if(DatumObject.GetDatumObjectType() == DatumObjectType.DATUM_CSYS)
				    {
					InterfInfoFile.write("\t Datum Object Type : CSYS");
					InterfInfoFile.newLine();
					CsysDatumObject CsysDatumObject = (CsysDatumObject)(DatumObject);
					
					WCsysData wCsysData = CsysDatumObject.GetCsysData();
					
					Vector3D XVector = wCsysData.GetXAxis ();
					InterfInfoFile.write("\t X- Axis : [ " + XVector.get(0) );
					InterfInfoFile.write(" " + XVector.get(1) );
					InterfInfoFile.write(" " + XVector.get(2) );
					InterfInfoFile.write(" ] ");
					InterfInfoFile.newLine();
					
					Vector3D YVector = wCsysData.GetYAxis ();
					InterfInfoFile.write("\t Y- Axis : [ " + YVector.get(0) );
					InterfInfoFile.write(" " + YVector.get(1) );
					InterfInfoFile.write(" " + YVector.get(2) );
					InterfInfoFile.write(" ] ");
					InterfInfoFile.newLine();
					
					Vector3D ZVector = wCsysData.GetZAxis ();
					InterfInfoFile.write("\t Z- Axis : [ " + ZVector.get(0) );
					InterfInfoFile.write(" " + ZVector.get(1) );
					InterfInfoFile.write(" " + ZVector.get(2) );
					InterfInfoFile.write(" ] ");
					InterfInfoFile.newLine();
					
					Vector3D Origin = wCsysData.GetOrigin ();
					InterfInfoFile.write("\t Origin : [ " + Origin.get(0) );
					InterfInfoFile.write(" " + Origin.get(1) );
					InterfInfoFile.write(" " + Origin.get(2) );
					InterfInfoFile.write(" ] ");
					InterfInfoFile.newLine();		
					
				    }
			    } // for(x)
		    } // if(DatumDatas)
		else
		    {
			InterfInfoFile.write("\t Total of Datum Data : 0");
			InterfInfoFile.newLine();
		    }
		
		// ************* Edge data info 
		
		EdgeDescriptors EdgeDescs = wInterfaceData.GetEdgeDescriptor();
		
		InterfInfoFile.write("\n******************* Interface Data : Edge Info ********************* ");
		InterfInfoFile.newLine();
		if(EdgeDescs != null)
		    {
			InterfInfoFile.write("\t Total of Edge Data : " + EdgeDescs.getarraysize() );
			InterfInfoFile.newLine();
			
			for(int y = 0; y < EdgeDescs.getarraysize(); y++)
			    {		
				EdgeDescriptor EdgeDesc = EdgeDescs.get(y);
				InterfInfoFile.write("\t--------- Edge Descriptor : " + (y+1) );
				InterfInfoFile.write(" -------- ");
				InterfInfoFile.newLine();
				
				EdgeSurfaceData EdgeSurfData1 = EdgeDesc.GetEdgeSurface1 ();
				
				InterfInfoFile.write("\t -- Edge Surface 1 -- ");
				InterfInfoFile.newLine();
				
				OtkUtilEdgeSurfaceDataInfo (EdgeSurfData1, InterfInfoFile);
				
				EdgeSurfaceData EdgeSurfData2 = EdgeDesc.GetEdgeSurface2 ();
				
				InterfInfoFile.write("\t -- Edge Surface 2 -- ");
				InterfInfoFile.newLine();
				
				OtkUtilEdgeSurfaceDataInfo (EdgeSurfData2, InterfInfoFile);
				
				CurveDescriptor CurveDesc = EdgeDesc.GetXYZCurveData ();
				
				OtkUtilCurveDescriptorInfo (CurveDesc, InterfInfoFile);	
			    } // for(y)
		    }
		else
		    {
			InterfInfoFile.write("\t Total of Edge Data : 0" );
			InterfInfoFile.newLine();
		    }
		
		// ************* Accuracy and Outline info 
		
		InterfInfoFile.write("\n******************* Interface Data : Accuracy Info ********************* ");
		InterfInfoFile.newLine();
		
		Accuracytype AccType = wInterfaceData.GetAccuracytype ();
		
		InterfInfoFile.write("\t Accuracy Type : " + OtkUtilAccuracyTypeEnumInfo(AccType.getValue()));
		InterfInfoFile.newLine();
		
		InterfInfoFile.write("\t Accuracy Value : " + wInterfaceData.GetAccuracy() );
		InterfInfoFile.newLine();
		
		Outline3D wOutline = wInterfaceData.GetOutline();
		
		Point3D Point1 = wOutline.get(0);
		
		Point3D Point2 = wOutline.get(1);
		
		InterfInfoFile.write("\t Outline Point 1 : [ " + Point1.get(0) );
		InterfInfoFile.write(" " + Point1.get(1) );
		InterfInfoFile.write(" " + Point1.get(2) );
		InterfInfoFile.write(" ]" );
		InterfInfoFile.newLine();
		
		InterfInfoFile.write("\t Outline Point 2 : [ " + Point2.get(0) );
		InterfInfoFile.write(" " + Point2.get(1) );
		InterfInfoFile.write(" " + Point2.get(2) );
		InterfInfoFile.write(" ]" );
		InterfInfoFile.newLine();
		
	    }
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
    }
    
    public static void OtkUtilSurfaceDescriptorInfo(WSurfaceDescriptor SurfDesc, BufferedWriter SurfInfoFile)
    {
	try
	    {
		SurfInfoFile.write("\t Surface Id : " + SurfDesc.GetSurfaceId());
		SurfInfoFile.newLine();
		ContourDescriptors ContourDescs = SurfDesc.GetContourData();
		
		if(ContourDescs != null)
		    {	
			for(int j = 0; j < ContourDescs.getarraysize(); j++)
			    {
				ContourDescriptor ContourDesc = ContourDescs.get(j);
				
				SurfInfoFile.write("\t Contour Traversal : " + OtkUtilContourTraversalEnumInfo(ContourDesc.GetContourTraversal().getValue()));
				SurfInfoFile.newLine();
				
				intseq EdgeIds = ContourDesc.GetEdgeIds();
				
				for(int k = 0; k < EdgeIds.getarraysize(); k++)
				    {
					SurfInfoFile.write("\t Edge Id : " + EdgeIds.get(k));
					SurfInfoFile.newLine();
				    }
			    } // for(int j)
		    } // if(ContourDescs )
		
		SurfaceType type = SurfDesc.GetSurfaceType();
		switch(type.getValue())
		    {
		    case SurfaceType._SURFACE_PLANE:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_PLANE ");
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);
			    
			    PlaneDescriptor Plane = (PlaneDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Plane);
			    
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_CYLINDER:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_CYLINDER ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);
			    
			    CylinderDescriptor Cylinder = (CylinderDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Cylinder);
			    
			    SurfInfoFile.write("\t Cylinder Radius : " + Cylinder.GetRadius());
			    SurfInfoFile.newLine();
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_CONE:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_CONE ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);	
			    
			    ConeDescriptor Cone = (ConeDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Cone);
			    
			    SurfInfoFile.write("\t Cone Alpha : " + Cone.GetAlpha());
			    SurfInfoFile.newLine();
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_TORUS:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_TORUS ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);	
			    
			    TorusDescriptor Torus = (TorusDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Torus);
			    
			    SurfInfoFile.write("\t Torus Radius 1 : " + Torus.GetRadius1());
			    SurfInfoFile.newLine();
			    SurfInfoFile.write("\t Torus Radius 2 : " + Torus.GetRadius2());
			    SurfInfoFile.newLine();
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    
			    break;
			}
		    case SurfaceType._SURFACE_RULED:		
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_RULED ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);
			    
			    RuledSurfaceDescriptor Rule = (RuledSurfaceDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Rule);
			    
			    CurveDescriptor Curve1 = Rule.GetProfile1();
			    OtkUtilCurveDescriptorInfo(Curve1, SurfInfoFile);
			    
			    CurveDescriptor Curve2 = Rule.GetProfile2();
			    OtkUtilCurveDescriptorInfo(Curve2, SurfInfoFile);
			    
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_REVOLVED:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_REVOLVED ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);	
			    
			    RevolvedSurfaceDescriptor Revolve = (RevolvedSurfaceDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Revolve);
			    
			    CurveDescriptor Curve = Revolve.GetProfile();
			    OtkUtilCurveDescriptorInfo(Curve, SurfInfoFile);
			    
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_TABULATED_CYLINDER:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_TABULATED_CYLINDER ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);
			    
			    TabulatedCylinderDescriptor Cylinder = (TabulatedCylinderDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Cylinder);
			    
			    CurveDescriptor Curve = Cylinder.GetProfile();
			    OtkUtilCurveDescriptorInfo(Curve, SurfInfoFile);
			    
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_FILLET:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_FILLET ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);	
				
			    FilletSurfaceDescriptor Fillet = (FilletSurfaceDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Fillet);
			    
			    SplineDescriptor U0Profile = Fillet.GetU0Profile();
			    OtkUtilSplineDescriptorInfo(U0Profile, SurfInfoFile);
			    
			    SplineDescriptor CenterProfile = Fillet.GetCenterProfile();
			    OtkUtilSplineDescriptorInfo(CenterProfile, SurfInfoFile);
			    
			    SplineDescriptor TanProfile = Fillet.GetTangentProfile();			
			    OtkUtilSplineDescriptorInfo(TanProfile, SurfInfoFile);
			    
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_COONS_PATCH:
			{					
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_COONS_PATCH ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);	
			    
			    CoonsPatchDescriptor Patch = (CoonsPatchDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Patch);
			    
			    CurveDescriptor U0Profile = Patch.GetU0Profile();
			    OtkUtilCurveDescriptorInfo(U0Profile, SurfInfoFile);
			    
			    CurveDescriptor U1Profile = Patch.GetU1Profile();
			    OtkUtilCurveDescriptorInfo(U1Profile, SurfInfoFile);
			    
			    CurveDescriptor V0Profile = Patch.GetV0Profile();
			    OtkUtilCurveDescriptorInfo(V0Profile, SurfInfoFile);
			    
			    CurveDescriptor V1Profile = Patch.GetV1Profile();
			    OtkUtilCurveDescriptorInfo(V1Profile, SurfInfoFile);
			    
			    CoonsCornerPoints Corner = Patch.GetCornerPoints ();
			    CoonsUVDerivatives Deriv = Patch.GetUVDerivatives ();
			    
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_SPLINE:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_SPLINE ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);	
			    
			    SplineSurfaceDescriptor Spline = (SplineSurfaceDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Spline);
			    
			    OtkUtilSplineSurfDescriptorInfo(Spline, SurfInfoFile);
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_NURBS:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_NURBS ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);
			    
			    NURBSSurfaceDescriptor Nurbs = (NURBSSurfaceDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Nurbs);
			    
			    SurfInfoFile.write("\t U Degree : " + Nurbs.GetUDegree());
			    SurfInfoFile.newLine();
			    SurfInfoFile.write("\t V Degree : " + Nurbs.GetVDegree());
			    SurfInfoFile.newLine();
			    
			    BSplinePoints SplinePoints = Nurbs.GetPoints();
			    for(int x = 0; x < SplinePoints.getarraysize(); x++)
				{
				    BSplinePoint SplinePoint = SplinePoints.get(x);
				    Double weight = SplinePoint.GetWeight();
				    if(weight.intValue() != 0)
					{
					    SurfInfoFile.write("\t Spline Point weight : " + weight);
					    SurfInfoFile.newLine();
					}
				    Point3D Point1 = SplinePoint.GetPoint ();
				    SurfInfoFile.write("\t Point : [ " + Point1.get(0));
				    SurfInfoFile.write(" " + Point1.get(1));
				    SurfInfoFile.write(" " + Point1.get(2));
				    SurfInfoFile.write(" ]" );
				    SurfInfoFile.newLine();
				}
			    
			    realseq UKnots = Nurbs.GetUKnots();
			    for(int i = 0; i < UKnots.getarraysize(); i++)
				{
				    SurfInfoFile.write("\t U Knot " + (i+1));
				    SurfInfoFile.write(" : " + UKnots.get(i));
				    SurfInfoFile.newLine();
				}
			    realseq VKnots = Nurbs.GetUKnots();
			    for(int j = 0; j < VKnots.getarraysize(); j++)
				{
				    SurfInfoFile.write("\t V Knot " + (j+1));
				    SurfInfoFile.write(" : " + VKnots.get(j));
				    SurfInfoFile.newLine();
				}
			    
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_CYLINDRICAL_SPLINE:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_CYLINDRICAL_SPLINE ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);			
			    
			    CylindricalSplineSurfaceDescriptor cSpline = (CylindricalSplineSurfaceDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(cSpline);
			    
			    SplineSurfaceDescriptor SplineSurf = cSpline.GetSplineSurfaceData ();
			    
			    OtkUtilSplineSurfDescriptorInfo(SplineSurf, SurfInfoFile);
			    
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_SPHERICAL_SPLINE:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_SPHERICAL_SPLINE ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);			
			    
			    SphericalSplineSurfaceDescriptor sSpline = (SphericalSplineSurfaceDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(sSpline);
			    
			    SplineSurfaceDescriptor SplineSurf = sSpline.GetSplineSurfaceData ();
			    
			    OtkUtilSplineSurfDescriptorInfo(SplineSurf, SurfInfoFile);
			    
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    case SurfaceType._SURFACE_FOREIGN:
			{
			    SurfInfoFile.write("\t Surface Descriptor type : SURFACE_FOREIGN ");
			    SurfInfoFile.newLine();
			    SurfaceDescriptor pSurfDesc = (SurfaceDescriptor)(SurfDesc);			
			    
			    ForeignSurfaceDescriptor Foreign = (ForeignSurfaceDescriptor)(pSurfDesc);
			    TransformedSurfaceDescriptor TransSurfDesc = (TransformedSurfaceDescriptor)(Foreign);
			    
			    SurfInfoFile.write("\t Foreign Id : " + Foreign.GetForeignID());
			    SurfInfoFile.newLine();
			    OtkUtilTransSurfaceDescriptorInfo (TransSurfDesc, SurfInfoFile);
			    break;
			}
		    } // switch()
		
		SurfInfoFile.write("\t Surface Orientation : " + OtkUtilSurfaceOrientationEnumInfo(SurfDesc.GetOrientation().getValue()));
		SurfInfoFile.newLine();
		
		SurfaceExtents SurfExtents = SurfDesc.GetExtents();
		
		if(SurfExtents != null)
		    {
			UVOutline UVOutline = SurfExtents.GetUVExtents();
			
			UVParams UVParams1 = UVOutline.get(0);
			
			UVParams UVParams2 = UVOutline.get(1);
			
			SurfInfoFile.write("\t UV Param 1 : [ " + UVParams1.get(0));
			SurfInfoFile.write(" " + UVParams1.get(1));
			SurfInfoFile.write(" ]");
			SurfInfoFile.newLine();
			
			SurfInfoFile.write("\t UV Param 2 : [ " + UVParams2.get(0));
			SurfInfoFile.write(" " + UVParams2.get(1));
			SurfInfoFile.write(" ]");
			SurfInfoFile.newLine();
			
			Outline3D XYZOutline = SurfExtents.GetXYZExtents();
			
			Point3D Point1 = XYZOutline.get(0);
			
			Point3D Point2 = XYZOutline.get(1);
			
			SurfInfoFile.write("\t XYZ Point 1 : [ " + Point1.get(0));
			SurfInfoFile.write(" " + Point1.get(1));
			SurfInfoFile.write(" " + Point1.get(2));
			SurfInfoFile.write(" ]");
			SurfInfoFile.newLine();
			
			SurfInfoFile.write("\t XYZ Point 2 : [ " + Point2.get(0));
			SurfInfoFile.write(" " + Point2.get(1));
			SurfInfoFile.write(" " + Point2.get(2));
			SurfInfoFile.write(" ]");
			SurfInfoFile.newLine();
		    }
	    }
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
    }
    
    public static void OtkUtilEdgeSurfaceDataInfo(EdgeSurfaceData EdgeSurfData, BufferedWriter SurfInfoFile)
    {
	try
	    {
		SurfInfoFile.write("\t Surface Id : " + EdgeSurfData.GetEdgeSurfaceId());
		SurfInfoFile.newLine();
		SurfInfoFile.write("\t Surface Direction : " + EdgeSurfData.GetDirection().getValue());
		SurfInfoFile.newLine();
		
		UVParamsSequence UVParams = EdgeSurfData.GetUVParamsSequence ();
		
		for(int i = 0; i < UVParams.getarraysize(); i++)
		    {
			UVParams UVParam = UVParams.get(i);
			SurfInfoFile.write("\t UV Param " + (i+1));
			SurfInfoFile.write(" : [ " +  UVParam.get(0));
			SurfInfoFile.write(" " + UVParam.get(1));
			SurfInfoFile.write(" ]");
			SurfInfoFile.newLine();
		    }
		CurveDescriptor CurveDesc = EdgeSurfData.GetUVCurveData ();
		
		if(CurveDesc != null)
		    OtkUtilCurveDescriptorInfo(CurveDesc, SurfInfoFile);	
		}
	catch (Exception e)
	    {
			System.out.println("1: " + e);
	    }
	
    }
    
    public static void OtkUtilTransSurfaceDescriptorInfo (TransformedSurfaceDescriptor TransDesc, BufferedWriter SurfInfoFile)
    {
	try
	    {
		Transform3D Trans3D = TransDesc.GetCoordSys ();
		
		Matrix3D Matrix = Trans3D.GetMatrix ();
		
		Vector3D VecX = Trans3D.GetXAxis ();

		Vector3D VecY = Trans3D.GetYAxis ();
		
		Vector3D VecZ = Trans3D.GetZAxis ();
		
		Point3D  Origin = Trans3D.GetOrigin ();
		
		SurfInfoFile.newLine();
		SurfInfoFile.write("\t Matrix : ");
		SurfInfoFile.newLine();
		
		for(int a = 0; a < 4; a++)
		    {
			SurfInfoFile.write("\t [ " + Matrix.get(a, 0));
			SurfInfoFile.write(" " +  Matrix.get(a, 1));
			SurfInfoFile.write(" " + Matrix.get(a, 2));
			SurfInfoFile.write(" " + Matrix.get(a, 3));
			SurfInfoFile.write(" ] ");
			SurfInfoFile.newLine();
		    }
		
		SurfInfoFile.write("\t X- Axis : [ " + VecX.get(0));
		SurfInfoFile.write(" " + VecX.get(1));
		SurfInfoFile.write(" " + VecX.get(2));
		SurfInfoFile.write(" ] ");
		SurfInfoFile.newLine();
			
		SurfInfoFile.write("\t Y- Axis : [ " + VecY.get(0));
		SurfInfoFile.write(" " + VecY.get(1));
		SurfInfoFile.write(" " + VecY.get(2));
		SurfInfoFile.write(" ] ");
		SurfInfoFile.newLine();
		
		SurfInfoFile.write("\t Z- Axis : [ " + VecZ.get(0));
		SurfInfoFile.write(" " + VecZ.get(1));
		SurfInfoFile.write(" " + VecZ.get(2));
		SurfInfoFile.write(" ] ");
		SurfInfoFile.newLine();
		
		SurfInfoFile.write("\t Point : [ " + Origin.get(0));
		SurfInfoFile.write(" " + Origin.get(1));
		SurfInfoFile.write(" " + Origin.get(2));
		SurfInfoFile.write(" ] ");
		SurfInfoFile.newLine();
	    }
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
    }
    
    public static void OtkUtilCurveDescriptorInfo (CurveDescriptor CurveDesc,BufferedWriter CurveInfoFile)
    {
	try
		{
		    CurveType type = CurveDesc.GetCurveType();
		    switch(type.getValue())
			{
			case CurveType._CURVE_COMPOSITE:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_COMPOSITE");
				CurveInfoFile.newLine();
				CompositeCurveDescriptor Composite = (CompositeCurveDescriptor)(CurveDesc);
				
				CurveDescriptors CurvDescs = Composite.GetElements ();
				    
				for(int i = 0; i < CurvDescs.getarraysize(); i++)
				    {
					OtkUtilCompCurveDescriptorInfo(CurvDescs.get(i), CurveInfoFile);				
				    }
				break;
			    }
			case CurveType._CURVE_POINT:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_POINT" );
				CurveInfoFile.newLine();
				
				PointDescriptor Point = (PointDescriptor)(CurveDesc);
				Point3D Point3D = Point.GetPoint ();
				
				CurveInfoFile.write("\t Point : [ " + Point3D.get(0));
				CurveInfoFile.write(" " + Point3D.get(1));
				CurveInfoFile.write(" " + Point3D.get(2));
				CurveInfoFile.write(" ]" );
					CurveInfoFile.newLine();
					break;
			    }
			case CurveType._CURVE_LINE:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_LINE" );
				CurveInfoFile.newLine();
				
				LineDescriptor Line = (LineDescriptor)(CurveDesc);
				Point3D Point1 = Line.GetEnd1 ();
				Point3D Point2 = Line.GetEnd2 ();
				
				CurveInfoFile.write("\t End 1 : [ " + Point1.get(0));
				CurveInfoFile.write(" " + Point1.get(1));
				CurveInfoFile.write(" " + Point1.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t End 2 : [ " + Point2.get(0));
				CurveInfoFile.write(" " + Point2.get(1));
				CurveInfoFile.write(" " + Point2.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				break;
			    }
			case CurveType._CURVE_ARROW:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_ARROW" );
				CurveInfoFile.newLine();
				
				ArrowDescriptor Arrow = (ArrowDescriptor)(CurveDesc);
				Point3D Point1 = Arrow.GetEnd1 ();
				Point3D Point2 = Arrow.GetEnd2 ();
				
				CurveInfoFile.write("\t End 1 : [ " + Point1.get(0));
				CurveInfoFile.write(" " + Point1.get(1));
				CurveInfoFile.write(" " + Point1.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t End 2 : [ " + Point2.get(0));
				CurveInfoFile.write(" " + Point2.get(1));
				CurveInfoFile.write(" " + Point2.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				break;
			    }
			case CurveType._CURVE_ARC:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_ARC" );
				CurveInfoFile.newLine();

				ArcDescriptor Arc = (ArcDescriptor)(CurveDesc);
				Vector3D Point1 = Arc.GetVector1 ();
				
				Vector3D Point2 = Arc.GetVector2 ();
				
				Point3D Center = Arc.GetCenter ();
				
				CurveInfoFile.write("\t Vector 1 : [ " + Point1.get(0));
				CurveInfoFile.write(" " + Point1.get(1));
				CurveInfoFile.write(" " + Point1.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t Vector 2 : [ " + Point2.get(0));
				CurveInfoFile.write(" " + Point2.get(1));
				CurveInfoFile.write(" " + Point2.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write( "\t Center  : [ " + Center.get(0));
				CurveInfoFile.write(" " + Center.get(1));
				CurveInfoFile.write(" " + Center.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t Start Angle : " + Arc.GetStartAngle ());
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t End Angle : " + Arc.GetEndAngle ());
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t Arc Radius : " + Arc.GetRadius ());
				CurveInfoFile.newLine();
				break;
			    }
			case CurveType._CURVE_SPLINE:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_SPLINE" );
				CurveInfoFile.newLine();
				
				SplineDescriptor SplineDesc = (SplineDescriptor)(CurveDesc);
				OtkUtilSplineDescriptorInfo(SplineDesc, CurveInfoFile);
				
				break;
			    }
			case CurveType._CURVE_BSPLINE:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_BSPLINE" );
				CurveInfoFile.newLine();
				
				BSplineDescriptor BSplineDesc = (BSplineDescriptor)(CurveDesc);
				BSplinePoints BSplinePoint = BSplineDesc.GetPoints ();
				
				for(int i = 0; i < BSplinePoint.getarraysize(); i++)
				    {
					BSplinePoint BSpline = BSplinePoint.get(i);
					Double weight = BSpline.GetWeight ();
					if(weight.intValue() != 0)
					    {
						CurveInfoFile.write("\t Weight : " + weight );
						CurveInfoFile.newLine();
					    }
					
					Point3D Point3D = BSpline.GetPoint();								
					CurveInfoFile.write("\t Point : [ " + Point3D.get(0));
					CurveInfoFile.write(" " + Point3D.get(1));
					CurveInfoFile.write(" " + Point3D.get(2));
					CurveInfoFile.write(" ]" );
					CurveInfoFile.newLine();
				    }
				CurveInfoFile.write("\t Degree : " + BSplineDesc.GetDegree () );
				CurveInfoFile.newLine();
				realseq knots =  BSplineDesc.GetKnots ();
					
				for(int j = 0; j < knots.getarraysize(); j++)
				    {
					CurveInfoFile.write("\t Knot " + (j+1));
					CurveInfoFile.write(" : " + knots.get(j) );
					CurveInfoFile.newLine();
				    }
				break;
			    }
			case CurveType._CURVE_CIRCLE:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_CIRCLE" );	
				CurveInfoFile.newLine();
				
				CircleDescriptor Circle = (CircleDescriptor)(CurveDesc);
				Point3D Point = Circle.GetCenter ();
				
				Vector3D Vector = Circle.GetUnitNormal ();
				
				CurveInfoFile.write("\t Point : [ " + Point.get(0));
				CurveInfoFile.write(" " + Point.get(1));
				CurveInfoFile.write(" " + Point.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
					
				CurveInfoFile.write("\t Unit Normal : [ " + Vector.get(0));
				CurveInfoFile.write(" " + Vector.get(1));
				CurveInfoFile.write(" " + Vector.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t Radius : " + Circle.GetRadius () );	
				CurveInfoFile.newLine();					
				break;
			    }
			case CurveType._CURVE_ELLIPSE:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : pfcCURVE_ELLIPSE" );	
				CurveInfoFile.newLine();
				
				EllipseDescriptor Ellipse = (EllipseDescriptor)(CurveDesc);
				Point3D Point = Ellipse.GetCenter ();
				
				Vector3D Vector = Ellipse.GetUnitNormal ();
				
				Vector3D Axis = Ellipse.GetUnitMajorAxis ();
				
				CurveInfoFile.write("\t Point : [ " + Point.get(0));
				CurveInfoFile.write(" " + Point.get(1));
				CurveInfoFile.write(" " + Point.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t Unit Normal : [ " + Vector.get(0));
				CurveInfoFile.write(" " + Vector.get(1));
				CurveInfoFile.write(" " + Vector.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t Unit Major Axis : [ " + Axis.get(0));
				CurveInfoFile.write(" " + Axis.get(1));
				CurveInfoFile.write(" " + Axis.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
					
				CurveInfoFile.write("\t Major Length : " + Ellipse.GetMajorLength () );
				CurveInfoFile.newLine();
					
				CurveInfoFile.write("\t Minor Length : " + Ellipse.GetMinorLength () );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t Start Angle : " + Ellipse.GetStartAngle () );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t End Angle : " + Ellipse.GetEndAngle () );
				CurveInfoFile.newLine();
				
				break;
				
			    }
			case CurveType._CURVE_POLYGON:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_POLYGON" );
				CurveInfoFile.newLine();
				
				PolygonDescriptor Polygon = (PolygonDescriptor)(CurveDesc);
				Point3Ds Points = Polygon.GetVertices ();
				
				for(int i = 0; i < Points.getarraysize(); i++)
				    {
					Point3D Point = Points.get(i);
					CurveInfoFile.write("\t Point : [ " + Point.get(0));
					CurveInfoFile.write(" " + Point.get(1));
					CurveInfoFile.write(" " + Point.get(2));
					CurveInfoFile.write(" ]" );
					CurveInfoFile.newLine();
				    }			
				break;
			    }
			case CurveType._CURVE_TEXT:
			    {
				CurveInfoFile.write("\t CurveDescriptor type : CURVE_TEXT" );
				CurveInfoFile.newLine();
				
				TextDescriptor Text = (TextDescriptor)(CurveDesc);
				Point3D Point = Text.GetPoint ();
				
				TextStyle TextStyle = Text.GetStyle ();
				
				CurveInfoFile.write("\t Point : [ " + Point.get(0));
				CurveInfoFile.write(" " + Point.get(1));
				CurveInfoFile.write(" " + Point.get(2));
				CurveInfoFile.write(" ]" );
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t Text : " + Text.GetTextString () ); 
				CurveInfoFile.newLine();
				
				CurveInfoFile.write("\t ---- TextStyle info ---- " ); 
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t\t Angle : " + TextStyle.GetAngle () ); 
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t\t Font Name : " + TextStyle.GetFontName () ); 
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t\t Height : " + TextStyle.GetHeight () ); 
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t\t Width Factor : " + TextStyle.GetWidthFactor () ); 
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t\t Slant Angle : " + TextStyle.GetSlantAngle () ); 
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t\t Thickness : " + TextStyle.GetThickness () ); 
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t\t IsUnderlined : " + TextStyle.GetIsUnderlined () );
				CurveInfoFile.newLine();
				CurveInfoFile.write("\t\t IsMirrored : " + TextStyle.GetIsMirrored () ); 
				CurveInfoFile.newLine();
				break;
			    }
			}
		}
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
    }
    
	public static void OtkUtilCompCurveDescriptorInfo (CurveDescriptor CurveDesc, BufferedWriter CCurveInfoFile)
    {
	try
	    {
		CCurveInfoFile.write("\t ------ Composite Curve Info ------- " );
		OtkUtilCurveDescriptorInfo(CurveDesc, CCurveInfoFile);
	    }
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
    }
    
    
    
    
    public static void OtkUtilSplineDescriptorInfo(SplineDescriptor SplineDesc, BufferedWriter SplineInfoFile)
    {
	try
	    {
		SplinePoints  SplinePoints = SplineDesc.GetPoints ();

		for(int i = 0; i < SplinePoints.getarraysize(); i++)
		    {
			SplinePoint Spline = SplinePoints.get(i);
			Point3D Point3D = Spline.GetPoint();
			
			Vector3D Vector = Spline.GetTangent();
			
			SplineInfoFile.write("\t Parameter : " + Spline.GetParameter ());
			SplineInfoFile.newLine();
			
			SplineInfoFile.write("\t Tangent : [ " + Vector.get(0));
			SplineInfoFile.write(" " + Vector.get(1));
			SplineInfoFile.write(" " + Vector.get(2));
			SplineInfoFile.write(" ]");
			SplineInfoFile.newLine();
			
			SplineInfoFile.write("\t Point : [ " + Point3D.get(0));
			SplineInfoFile.write(" " + Point3D.get(1));
			SplineInfoFile.write(" " + Point3D.get(2));
			SplineInfoFile.write(" ]");
			SplineInfoFile.newLine();
		    }
	    }
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
    }
    
    public static void OtkUtilSplineSurfDescriptorInfo(SplineSurfaceDescriptor cSpline, BufferedWriter SurfInfoFile)
    {
	try
	    {
		SplineSurfacePoints Points = cSpline.GetPoints ();
		for(int i = 0; i < Points.getarraysize(); i++)
		    {
			SplineSurfacePoint Point = Points.get(i);
			UVParams Params = Point.GetParameter ();
			
			SurfInfoFile.write("\t UV Param  : [ " + Params.get(0));
			SurfInfoFile.write(" " + Params.get(1));
			SurfInfoFile.write(" ]");
			SurfInfoFile.newLine();
			
			Point3D Point3D = Point.GetPoint ();
			SurfInfoFile.write("\t Point  : [ " + Point3D.get(0));
			SurfInfoFile.write(" " + Point3D.get(1));
			SurfInfoFile.write(" ]");
			SurfInfoFile.newLine();
			
			Vector3D UTangent = Point.GetUTangent ();
			if(UTangent != null)
			    {	
				SurfInfoFile.write("\t U Tangent : [" + UTangent.get(0));
				SurfInfoFile.write(" " + UTangent.get(1));
				SurfInfoFile.write(" " + UTangent.get(2));
				SurfInfoFile.write(" ]" );
				SurfInfoFile.newLine();
			    }	
			
			Vector3D VTangent = Point.GetVTangent ();
			if(VTangent != null)
			    {	
				SurfInfoFile.write("\t V Tangent : [" + VTangent.get(0));
				SurfInfoFile.write(" " + VTangent.get(1));
				SurfInfoFile.write(" " + VTangent.get(2));
				SurfInfoFile.write(" ]" );
				SurfInfoFile.newLine();
			    }
			
			Vector3D Deriv = Point.GetUVDerivative ();
			if(Deriv != null)
			    {	
				SurfInfoFile.write("\t Derivative : [" + Deriv.get(0));
				SurfInfoFile.write(" " + Deriv.get(1));
				SurfInfoFile.write(" " + Deriv.get(2));
				SurfInfoFile.write(" ]" );
				SurfInfoFile.newLine();
			    }
		    }
	    }
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
	
    }
    
    public static String OtkUtilAccuracyTypeEnumInfo(int Id)
    {
	try
	    {
		switch(Id)
		    {
		    case Accuracytype._ACCU_NONE:		return("ACCU_NONE");
		    case Accuracytype._ACCU_RELATIVE:		return("ACCU_RELATIVE");
		    case Accuracytype._ACCU_ABSOLUTE:		return("ACCU_ABSOLUTE");
		    case 3:	return("Accuracytype_nil");		
			
		    default: return ("*** Unknown enum in method OtkAccuracyTypeEnumLookup");
		    }
	    }
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
	return null;
    }
    public static String OtkUtilContourTraversalEnumInfo(int Id)
    {
	try
	    {
		switch(Id)
		    {
		    case ContourTraversal._CONTOUR_TRAV_NONE:		return("CONTOUR_TRAV_NONE");
		    case ContourTraversal._CONTOUR_TRAV_INTERNAL:		return("CONTOUR_TRAV_INTERNAL");
		    case ContourTraversal._CONTOUR_TRAV_EXTERNAL:		return("CONTOUR_TRAV_EXTERNAL");
		    case 3:		return("ContourTraversal_nil");		
			
		    default: return ("*** Unknown enum in method OtkContourTraversalEnumLookup");
		    }
	    }
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
	return null;
    }
    public static String OtkUtilSurfaceOrientationEnumInfo(int Id)
    {
	try
	    {
		switch(Id)
		    {
		    case SurfaceOrientation._SURFACEORIENT_NONE:		return("SURFACEORIENT_NONE");
		    case SurfaceOrientation._SURFACEORIENT_OUTWARD:		return("SURFACEORIENT_OUTWARD");
		    case SurfaceOrientation._SURFACEORIENT_INWARD:		return("SURFACEORIENT_INWARD");
		    case 3:		return("SurfaceOrientation_nil");		
			
		    default: return ("*** Unknown enum in method OtkSurfaceOrientationEnumLookup");
		    }
	    }
	catch (Exception e)
	    {
		System.out.println("1: " + e);
	    }
	return null;
    }
    
    
};
// *************************************************************************************************************** /





